﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Reports.aspx.cs" Inherits="CourseScheduling.Reports" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            height: 30px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="Label1" runat="server" 
        Text="Please Select Your Preferred Report Type"></asp:Label>
    <asp:SqlDataSource ID="Sqlyears" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="if object_id('#years','u') is not null
drop table #years ;
create table #years(yr int not null);
insert into #years
select distinct [year] from preference;
insert into #years
select distinct yearRequest from studentRequest;
select distinct yr from #years;">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="Sqlterm" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" SelectCommand="if object_id('#terms','u') is not null
drop table #terms ;
create table #terms(term varchar(20) not null);
insert into #terms
select distinct Term from preference;
insert into #terms
select distinct semesterRequest from studentRequest;
select distinct term from #terms;
"></asp:SqlDataSource>
    <table>
    <tr>
        <td class="style1">
            <asp:Label ID="Label2" runat="server" Text="Report Type"></asp:Label>
        </td>
        <td class="style1">
            <asp:DropDownList ID="ddlReports" runat="server">
                <asp:ListItem Value="0">Day Listing</asp:ListItem>
                <asp:ListItem Value="1">Time Listing</asp:ListItem>
                <asp:ListItem Value="2">Student Listing</asp:ListItem>
                <asp:ListItem Value="3">Faculty Listing</asp:ListItem>
                <asp:ListItem Value="4">Course Listing</asp:ListItem>
            </asp:DropDownList>
        </td>
        <td class="style1">
            <asp:Label ID="Label3" runat="server" Text="Report Year"></asp:Label>
        </td>
        <td class="style1">
            <asp:DropDownList ID="ddlYear" runat="server">
                <asp:ListItem Selected="True" Value="All"></asp:ListItem>
            </asp:DropDownList>
        </td>
        <td class="style1">
            <asp:Label ID="Label4" runat="server" Text="Report Term"></asp:Label>
        </td>
        <td class="style1">
            <asp:DropDownList ID="ddlterm" runat="server">
                <asp:ListItem Selected="True">All</asp:ListItem>
            </asp:DropDownList>
        </td>
        <td class="style1">
            <asp:Button ID="btnView" runat="server" Text="View" onclick="btnView_Click" />
        </td>
    </tr>
    </table>
    <asp:SqlDataSource ID="sqlCourseListing" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT * FROM [vw_courseListing]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlTimeListing" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT * FROM [vw_timeListing]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlStudentListing" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT * FROM [vw_studentListing]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlFacultyListing" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT [NNumber], [Term], [Year], [CourseNumber], [CourseName], [cRank], [id] FROM [vw_facultyListing]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDayListing" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT * FROM [vw_dayListing]"></asp:SqlDataSource>
    <asp:GridView ID="gvCourseListing" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" 
        GridLines="None" Visible="False">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="yearRequest" HeaderText="Year" 
                SortExpression="yearRequest" />
            <asp:BoundField DataField="semesterRequest" HeaderText="Term" 
                SortExpression="semesterRequest" />
            <asp:BoundField DataField="CourseNumber" HeaderText="Course Number" 
                SortExpression="CourseNumber" />
            <asp:BoundField DataField="CourseName" HeaderText="Course Name" 
                SortExpression="CourseName" />
            <asp:BoundField DataField="sCount" HeaderText="Students" 
                SortExpression="sCount" />
            <asp:BoundField DataField="pCount" HeaderText="Instructors" ReadOnly="True" 
                SortExpression="pCount" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:GridView ID="gvStudentListing" runat="server" 
        AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
        GridLines="None" Visible="False" Width="100%">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="StudentName" HeaderText="Name" />
            <asp:BoundField DataField="NNumber" HeaderText="N Number" />
            <asp:BoundField DataField="degreeProgram" HeaderText="Degree Program" />
            <asp:BoundField DataField="yearRequest" HeaderText="Year" />
            <asp:BoundField DataField="semesterRequest" HeaderText="Term" />
            <asp:BoundField DataField="CourseNumber" HeaderText="Course Number" />
            <asp:BoundField DataField="CourseName" HeaderText="Course Name" />
            <asp:BoundField DataField="Description" HeaderText="Days" />
            <asp:BoundField DataField="TimeOfDayRequest" HeaderText="Time"  />
            <asp:CheckBoxField DataField="Required" HeaderText="Required" />
            <asp:BoundField DataField="DateSubmitted" HeaderText="DateSubmitted" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:GridView ID="gvTimeListing" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="yearRequest" HeaderText="Year" 
                SortExpression="yearRequest" />
            <asp:BoundField DataField="semesterRequest" HeaderText="Term" 
                SortExpression="semesterRequest" />
            <asp:BoundField DataField="Description" HeaderText="Days" 
                SortExpression="Description" />
            <asp:BoundField DataField="TimeOfDayRequest" HeaderText="Time" 
                SortExpression="TimeOfDayRequest" />
            <asp:BoundField DataField="CourseNumber" HeaderText="Course Number" 
                SortExpression="CourseNumber" />
            <asp:BoundField DataField="CourseName" HeaderText="Course Name" 
                SortExpression="CourseName" />
            <asp:BoundField DataField="scount" HeaderText="Students" 
                SortExpression="scount" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:GridView ID="gvFacultyListing" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataKeyNames="id" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="NNumber" HeaderText="N Number" 
                SortExpression="NNumber" />
            <asp:BoundField DataField="Year" HeaderText="Year" SortExpression="Year" />
            <asp:BoundField DataField="Term" HeaderText="Term" SortExpression="Term" />
            <asp:BoundField DataField="CourseNumber" HeaderText="Course Number" 
                SortExpression="CourseNumber" />
            <asp:BoundField DataField="CourseName" HeaderText="Course Name" 
                SortExpression="CourseName" />
            <asp:BoundField DataField="cRank" HeaderText="Course Rank" 
                SortExpression="cRank" />
            <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" 
                SortExpression="id" Visible="False" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:GridView ID="gvDayListing" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" 
        GridLines="None" Visible="False">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="yearRequest" HeaderText="Year" 
                SortExpression="yearRequest" />
            <asp:BoundField DataField="semesterRequest" HeaderText="Term" 
                SortExpression="semesterRequest" />
            <asp:BoundField DataField="Description" HeaderText="Days" 
                SortExpression="Description" />
            <asp:BoundField DataField="CourseNumber" HeaderText="Course Number" 
                SortExpression="CourseNumber" />
            <asp:BoundField DataField="CourseName" HeaderText="Course Name" 
                SortExpression="CourseName" />
            <asp:BoundField DataField="sCount" HeaderText="Students" 
                SortExpression="sCount" />
            <asp:BoundField DataField="pCount" HeaderText="Instructors" ReadOnly="True" 
                SortExpression="pCount" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
</asp:Content>
